<div class='login-window'>
	<div class='container'>
		<div class='weui-flex'>
			<div class='weui-flex__item login-window-title hidden-xs' style="padding:50px;">
				<h1>欢迎加入“重卡汇”</h1>
			</div>
			<div class='login-window-container bg-blur-white'>
				<div id='login-doing' >{include file='module:login' /}</div>
				<div id='login-success' style="text-align: center;" class='bc-info' cache='user' data-port='http://api.hongyanche.com/user/info'>
					<headimgurl info=i><img class='headimg' /></headimgurl><br/>
					<h2><user_name info=1></user_name></h2>
					<small mute>您已登录 <a class='link' href='#my'>个人中心</a></small>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">

    if(GET('wxbind')){
	    alert('请使用手机短信注册');
	}
	$.ajax({
		url:"/user/info",
		type:'POST',
        xhrFields:{
            withCredentials:true
        },
		success:function (data) {
			if(data.state){
                location.href='#my';
                $('#login-doing').hide();
			}else{
                if(WEIXIN.is()){
                    //WEIXIN.login();
                }else{
                    $('#login-success').hide();
                }
			}
        }
	})
//	if(!INFO.cache.user){
//       console.log(INFO.cache);
//       console.log('--------------------');
//        if(WEIXIN.is()){
//			//WEIXIN.login();
//		}else{
//			$('#login-success').hide();
//		}
//    }else{
//		// history.back();
//		 location.href='#my';
//		$('#login-doing').hide();
//		if(PAGE.stack.length>1){
//			// history.back();
//		}else{
//			// location.href='#';
//		}
//	}
</script>